﻿@page
@model WebAddress.Pages.Adr.IndexModel

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>

<p>
    <a asp-page="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].FirstName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].MiddleName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].LastName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].Street)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].City)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].State)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Address[0].Zipcode)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model.Address) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.FirstName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.MiddleName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Street)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.City)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.State)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Zipcode)
            </td>
            <td>
                <a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
                <a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
                <a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
